package com.tql.mall.rabbit.constant;

/**
 * @Author: tyk
 * @Date: 2023/5/18 20:34
 * @Description: MQ常量类：统一管理交换机、路由、队列的名称
 */
public class MqConstant {

    /**
     * 默认值
     */
    public static final int DEFAULT_RETRY_COUNT = 5; // 默认重试次数
    public static final boolean DEFAULT_IS_DELAY = false;    // 是否默认是延迟消息
    public static final int DEFAULT_DELAY_TIME = 10 * 1000;   // 默认延迟时间，单位：毫秒
    public static final int MSG_CACHE_TIME = 10;    // 消息缓存到Redis的过期时间，单位：分钟


    /**
     * RabbitMQ的部分参数名
     */

    public static final String SPRING_RETURNED_MESSAGE_CORRELATION = "spring_returned_message_correlation";


    /**
     * 商品上下架.
     */
    public static final String EXCHANGE_GOODS = "goods";
    public static final String ROUTING_GOODS_ON = "goods.on";
    public static final String ROUTING_GOODS_OFF = "goods.off";
    //队列
    public static final String QUEUE_GOODS_ON = "goods.on";
    public static final String QUEUE_GOODS_OFF = "goods.off";


    /**
     * 取消订单，发送延迟队列
     */
    public static final String EXCHANGE_ORDER_CANCEL = "oder.cancel";
    public static final String ROUTING_ORDER_CANCEL = "order.cancel";
    //延迟取消订单队列
    public static final String QUEUE_ORDER_CANCEL = "order.cancel";

    // 订单支付时间（超时取消订单）
    public static final int ORDER_DELAY_TIME = 10 * 60 * 1000;



    /**
     * 支付成功修改订单状态并拆单
     */
    public static final String EXCHANGE_PAY = "pay";
    public static final String ROUTING_PAY = "pay";

    public static final String QUEUE_PAY = "pay";
}
